home *** CD-ROM | disk | FTP | other *** search
/ LiquidLibrary 2005 September / LiquidLibrary 2005 Sep - Disc 1.iso / pc / Portfolio Browser / Filters / PDF / LIB / gs_ccfnt.ps < prev    next >
Text File  |  2003-01-03  |  2KB  |  66 lines

  1. %    Copyright (C) 1994, 2000 Aladdin Enterprises.  All rights reserved.
  2. % This software is licensed to a single customer by Artifex Software Inc.
  3. % under the terms of a specific OEM agreement.
  4.  
  5. % $RCSfile$ $Revision$
  6. % Find and register all the precompiled font operators in systemdict.
  7.  
  8. /registerfont            % <fontname> <fontdict> registerfont <font>
  9.  { DEBUG { (Registering ) print 1 index = } if
  10.    dup begin
  11.      Encoding type /nametype eq
  12.       { Encoding .findencoding /Encoding exch def
  13.       }
  14.      if
  15.      dup /PrefEnc known
  16.       { PrefEnc type /nametype eq
  17.      { PrefEnc .findencoding /PrefEnc exch def
  18.      }
  19.     if
  20.       }
  21.      if
  22.      dup /FDepVector known
  23.       { /FDepVector [ FDepVector
  24.      { .FontDirectory 1 index .knownget
  25.         { exch pop }
  26.         { ccfonts 1 index .knownget
  27.            { registerfont
  28.            }
  29.            { Fontmap 1 index known
  30.           { findfont }
  31.           { pop NullFont }
  32.          ifelse
  33.            }
  34.           ifelse
  35.         }
  36.        ifelse
  37.      }
  38.     forall ] readonly def
  39.       }
  40.      if
  41.    end
  42.    % Use the value of definefont appropriate at run-time, not bind-time
  43.    /definefont load exec
  44.  } bind odef
  45. % Bind recursive call (bind descends into oparrays: feature!)
  46. /registerfont dup load bind def
  47.  
  48. /.loadinitialfonts {
  49.   //.loadinitialfonts exec
  50.   NOCCFONTS not {
  51.     /ccfonts mark
  52.       0 1 null .getccfont 1 sub { .getccfont dup /FontName get exch } for
  53.     .dicttomark def
  54.         % Make sure these fonts are registered as "resources".
  55.     currentfile {
  56.       pop ccfonts {
  57.     .FontDirectory 2 index known { pop pop } { registerfont pop } ifelse
  58.       } forall
  59.     } .execasresource
  60.     currentdict /ccfonts .undef
  61.   } if
  62. } bind def
  63.  
  64. currentdict /registerfont .undef
  65.